<!DOCTYPE html>
<html lang="en" xmlns:thn="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
</head>
<body>
<!--注册页面-->
<form th:action="@{/user/reg}" method="post">
    用户名: <input type="text" name="username"><br>
    密码: <input type="password" name="password"><br>
    性别:
    男<input type="radio" name="sex" value="1">
    女<input type="radio" name="sex" value="0">
    <br>
    兴趣:
    阅读<input type="checkbox" name="interest" value="Reading">
    敲代码<input type="checkbox" name="interest" value="Type the code">
    学习<input type="checkbox" name="interest" value="study">
    <br>
    简介
    <textarea cols="60" rows="10" name="intro"></textarea>
    <br>
    年龄:<input type="text" name="age"><br>
    <input type="submit" value="注册">
</form>

<script type="text/javascript">
    function sendCookie(){
        document.cookie = "id=123456789; expires=Thu, 18 Dec 2025 12:00:00 UTC; path=/";
        document.location = "/springmvc/user/reg";
    }
</script>
<!--发送的是 get 请求-->
<button onclick="sendCookie()">向服务器端发送Cookie</button>

</body>
</html>